package org.mookt.dcubed;

import java.util.Objects;

public class Car implements AggregateRoot<Integer> {

    private final Integer id;

    public Car(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        } else if (obj instanceof Car) {
            Car that = (Car) obj;
            return Objects.equals(this.id, that.id);
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }
}